Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

211
Visualizações
How to solve the "module not found error"? webpack 5 no longer includes polyfills for node.js core modules by default

I am working on a react application where several peices of text can be shared on twitter using a button. This button would utilise the twitter api v2 so i installed the twitter-api-v2 npm package and made an object as shown here:

const { TwitterApi } = require("twitter-api-v2");

But I am getting the same errors as seen in this question: How to Polyfill node core modules in webpack 5 (I have also tried other twitter api clients' npm packages and they all result in such errors or more even) Except mine are for the packages: crypto, https, zlib and the final 2 errors are of "can't resolve fs"

I have tried the method of creating a webpack.config.js in the root of the project and adding the following code and installing the packages (as the error messages suggest) but it did not help. My webpack.config.js:

module.exports = {
  resolve: {
    fallback: {
      crypto: require.resolve("crypto-browserify"),
      https: require.resolve("https-browserify"),
      zlib: require.resolve("browserify-zlib"),
      fs: false,
    },
  },
};

Are there other solutions i can follow or is there another way for me to tweet a thread of some pieces of texts? Thanks in advance!

about 4 years ago · Juan Pablo Isaza
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda